package main

import (
	"go_rabbitmq/consumer"
	"go_rabbitmq/producter"
	"time"
)

func main() {
	ConsumerHost := "amqp://guest:guest@192.168.10.138:5672//davel"
	go consumer.Consumer(ConsumerHost, "davelTopic", []string{"davel.*"})
	go consumer.Consumer(ConsumerHost, "davelTopic", []string{"davel.#"})
	go consumer.Consumer(ConsumerHost, "davelTopic", []string{"#.#"})

	time.Sleep(5 * time.Second)
	producterHost := "amqp://guest:guest@192.168.10.138:5672//davel"
	producter.Producter(producterHost, "davelTopic", "davel.aaa", "Hello RabbitMQ davel.aaa")
	producter.Producter(producterHost, "davelTopic", "davel", "Hello RabbitMQ davel")
	producter.Producter(producterHost, "davelTopic", "aaa.aaa", "Hello RabbitMQ aaa.aaa")

	forever := make(chan bool)
	<-forever
}
